Total Ways In Matrix Dynamic Programming